<?php
namespace app\utils;

class ResposeUtils{
    static function ok($any, int $code=200,$total=0,$message=''){
        return json([
            "total"=>$total,
            "data" => $any,
            "code"=>$code,
            "success"=>true,
            "message"=>$message
        ]);

    }


    static function failRes(string $message,$any=null, int $code=500)
    {
        return json([
            "message"=>$message,
            "data" => $any,
            "code" => $code,
            "success" => false
        ]);
    }
}

